package com.javasm.domin.entity.orderEntity;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @TableName b2c_shoppingcart
 */
@Data
public class B2cShoppingcart implements Serializable {
    /**
     * 商品id
     */
    private Integer id;


    private Integer shoppingId;

    /**
     * 商品名称
     */
    private String goodsName;

    /**
     * 商品类型
     */
    private Integer typeId;

    /**
     * 商品型号
     */
    private String modelId;
    /**
     * 品牌ID
     */
    private Integer brandId;

    /**
     * 商品颜色
     */
    private Integer colourId;

    /**
     * 购买价格
     */
    private BigDecimal goodPrice;

    /**
     * 购买数量
     */
    private Integer goodNumber;

    /**
     * 商品总金额
     */
    private BigDecimal goodMoney;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        B2cShoppingcart other = (B2cShoppingcart) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getGoodsName() == null ? other.getGoodsName() == null : this.getGoodsName().equals(other.getGoodsName()))
                && (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId()))
                && (this.getModelId() == null ? other.getModelId() == null : this.getModelId().equals(other.getModelId()))
                && (this.getColourId() == null ? other.getColourId() == null : this.getColourId().equals(other.getColourId()))
                && (this.getGoodPrice() == null ? other.getGoodPrice() == null : this.getGoodPrice().equals(other.getGoodPrice()))
                && (this.getGoodNumber() == null ? other.getGoodNumber() == null : this.getGoodNumber().equals(other.getGoodNumber()))
                && (this.getGoodMoney() == null ? other.getGoodMoney() == null : this.getGoodMoney().equals(other.getGoodMoney()))
                && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode());
        result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
        result = prime * result + ((getModelId() == null) ? 0 : getModelId().hashCode());
        result = prime * result + ((getColourId() == null) ? 0 : getColourId().hashCode());
        result = prime * result + ((getGoodPrice() == null) ? 0 : getGoodPrice().hashCode());
        result = prime * result + ((getGoodNumber() == null) ? 0 : getGoodNumber().hashCode());
        result = prime * result + ((getGoodMoney() == null) ? 0 : getGoodMoney().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", goodsName=").append(goodsName);
        sb.append(", typeId=").append(typeId);
        sb.append(", modelId=").append(modelId);
        sb.append(", colourId=").append(colourId);
        sb.append(", goodPrice=").append(goodPrice);
        sb.append(", goodNumber=").append(goodNumber);
        sb.append(", goodMoney=").append(goodMoney);
        sb.append(", brandId=").append(brandId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}